package org.codeart.command.example01;

public class Client {

    public static void main(String[] args) {
        Order order1 = new Order();
        order1.setDiningTable(2);
        order1.put("十翅一桶", 2);
        order1.put("北京烤鸭", 1);

        Order order2 = new Order();
        order2.setDiningTable(8);
        order2.put("宫保鸡丁", 1);
        order2.put("烤鱼", 1);
        
        // 创建接收者
        Chef chef = new Chef();
        
        // 将订单和接收者封装成命令对象
        Command cmd1 = new OrderCommand(chef, order1);
        Command cmd2 = new OrderCommand(chef, order2);
        
        // 创建调用者
        Waiter waiter = new Waiter();
        waiter.addCommand(cmd1);
        waiter.addCommand(cmd2);
        
        // 把订单发送给厨师上菜
        waiter.orderUp();
    }

}
